-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatically create folder in project manager create and import #56420
Conversation
When the project name is "Test" and "Create Folder" is on, project path is I'm not sure if this is expected. If yes, would it be better to place the button somewhere else because it's now not "that" related to the project name as before. Also, should "Create Folder" use a CheckBox instead of a CheckButton? Because the control does not have immediate effect (the folder is not immediately created). To summarize:
|
This is the behavior I intended. Some users might want to make the directory name different from the project name (e.g.
I agree that moving the button somewhere else would make sense, but the only other place I can think of would be below the name/path fields, taking more vertical space.
I think a
I tried my best to make it intuitive and straightforward for most use-cases. I've already considered changing the text on the button, but I couldn't decide on what to change it to. Edit: I see two potential improvements, adding them to the root PR. |
It could go on the right side of an hbox with the "Project Path:" label. |
ea1fb1e
to
06714f6
Compare
c8df18a
to
06a8330
Compare
06a8330
to
8651c04
Compare
@nathanfranke Thanks for adding this 🙂 Does it prevent creating the project? It should, as users should never be able to brick their Godot editor installation entirely. Also, I'd rephrase it slightly:
The check should be performed on both |
Yes How do I get the home directory? |
Probably like this: #ifdef WINDOWS_ENABLED
const String home_dir = OS::get_singleton()->get_environment("USERPROFILE")
#else
const String home_dir = OS::get_singleton()->get_environment("HOME")
#endif
if (home_dir != "") {
// Do check.
}
See also godot/editor/editor_settings.cpp Line 472 in 1e553e3
|
8651c04
to
6ccbbf5
Compare
6ccbbf5
to
c1eb7e2
Compare
|
ebcbedd
to
1b60c84
Compare
This is ready for 4.1 if desired |
I second KoBeWi's concerns here, by the way. I have yet to look into this PR in detail, but why exactly the changes are so extensive for such an isolated feature? Can the changeset be reduced somehow? Full disclosure, I need to work on the project manager, and this PR is going to get in the way. So I either have to accept it or ignore it. Making sure this PR doesn't exceed its own scope would be a great help. |
I am reworking this to reduce the changes, will take a few days. |
Thanks, I appreciate it! I took a look over the weekend and I think it all pretty much makes sense and at least changes are isolated to one class, for the most part. Renames for clarity are also very nice to have. So at a glance I'm not sure what specifically can be simplified, but an attempt at that is very much welcome. KoBeWi mentioned that perhaps the folder naming scheme feature can be cut, and I agree that it is probably not very necessary, but since it's already implemented then it makes sense to keep it. |
556e676
to
f46bce7
Compare
This can be rebased / redone after #87266. |
f46bce7
to
9cf3615
Compare
@@ -880,6 +880,9 @@ | |||
<member name="project_manager/default_renderer" type="String" setter="" getter=""> | |||
The renderer type that will be checked off by default when creating a new project. Accepted strings are "forward_plus", "mobile" or "gl_compatibility". | |||
</member> | |||
<member name="project_manager/directory_naming_convention" type="int" setter="" getter=""> | |||
Directory naming convention for the project manager. Options are "No convention" (project name is directory name), "kebab-case" (default), "snake_case", "camelCase", "PascalCase", or "Title Case". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is "kebab-case" (default) the default for filenames? I thought it was snake_case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now, the default is kebab-case and it replaces underscores: t e_s-t
→ t-e-s-t
It would probably be better to keep underscores instead: t e_s-t
→ t-e_s-t
Could be implemented like this: dir_name = project_name.to_lower().replace(" ", "-")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default (kebab-case) is now implemented as to_lower().replace(" ", "-")
. So underscores are preserved: t e_s-t
→ t-e_s-t
9cf3615
to
5421e55
Compare
Thanks for the patience, rebased and ready. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally, looks pretty good! It's a great usability improvement, I really disliked how this worked until now.
The code changes are pretty hard to review in depth, for future PRs please try to keep refactoring separate from feature work. There's a lot of changes here which are just moving things around or slightly improving code quality which make the functional changes challenging to review. But overall it seems ok to me.
5421e55
to
2130f11
Compare
Thanks! And thanks for your patience and getting this PR to the finish line! |
It seems that this PR introduced a usability issue described in #94081. |
Edit:
2023-09-07 - I am busy, but once I have time this will be my top priority PR.2023-10-17 - I am working on this slowly 🙂2023-10-18 - Rebased and happy, but should wait for 4.3 😃
Supersedes #49602
Fixes #60332
Fixes #74678
Resolves godotengine/godot-proposals#4749
Resolves godotengine/godot-proposals#2754
Partly r3solves godotengine/godot-proposals#7978
Behavior:
kebab-case
(default),snake_case
, etc.Potential improvements:
Behavior ofFixed, nowcapitalize()
meanstest5
turns intotest-5/
.test5
-->test5/
create_dir
is pressed. Would we need an editor setting?Video:
2023-02-18.19-51-22_.mp4
Creation:
Import: